package com.ktwlsoft.archivemanage.domain.business.businessService;

import com.ktwlsoft.archivemanage.domain.business.repositoryService.businessInspect.BusinessInspectRepositoryService;
import com.ktwlsoft.archivemanage.payload.businessInspect.EfficiencyOfGuidanceAndMendOfPoint;
import com.ktwlsoft.archivemanage.payload.businessInspect.InspectEfficiencyPoint;
import com.ktwlsoft.archivemanage.service.security.UserPrincipal;
import org.springframework.stereotype.Service;

import java.time.Year;
import java.util.List;

@Service
public class ArchivistEfficiencyProfileService {

    private final BusinessInspectRepositoryService businessInspectRepositoryService;

    public ArchivistEfficiencyProfileService(BusinessInspectRepositoryService businessInspectRepositoryService) {
        this.businessInspectRepositoryService = businessInspectRepositoryService;
    }

    public List<InspectEfficiencyPoint> getAvgMarkOfYears(Long instructorId) {
        return businessInspectRepositoryService.getAvgMarkOfYearsOfInstructor(instructorId, null);
    }

    public List<InspectEfficiencyPoint> getAvgMarkOfYearsOfInstructor(Year year) {
        return businessInspectRepositoryService.getAvgMarkOfYearsOfInstructor(null, year);
    }

    public List<InspectEfficiencyPoint> getSelfOrRepeatAvgMarkOfYears(Long instructorId) {
        return businessInspectRepositoryService.getSelfOrRepeatAvgMarkOfYearsOfInstructor(instructorId, null);
    }

    public List<InspectEfficiencyPoint> getSelfOrRepeatAvgMarkOfYearsOfInstructor(Year year) {
        return businessInspectRepositoryService.getSelfOrRepeatAvgMarkOfYearsOfInstructor(null, year);
    }

    public List<EfficiencyOfGuidanceAndMendOfPoint> getEfficiencyOfGuianceAndMend(Year year) {
        return businessInspectRepositoryService.getEfficiencyOfGuianceAndMend(year);
    }

    public List<EfficiencyOfGuidanceAndMendOfPoint> getSelfOrRepeatEfficiencyOfGuianceAndMend(Year year) {
        return businessInspectRepositoryService.getSelfOrRepeatEfficiencyOfGuianceAndMend(year);
    }
}
